package action_行为型.interpreter_pattern_解释器模式;

/**
 * Created with IntelliJ IDEA.
 *
 * @Auther: hihi
 * @Date: 2020/07/08/11:15
 * @Description:
 */
public class OrExpression implements Expression {

	private Expression expression1;

	private Expression expression2;

	public OrExpression(Expression expression1, Expression expression2) {
		this.expression1 = expression1;
		this.expression2 = expression2;
	}

	/**
	 * 说明
	 *
	 * @param context
	 * @return
	 */
	@Override public boolean interpret(String context) {
		return expression1.interpret(context) || expression2.interpret(context);
	}
}
